class CreateVotes < ActiveRecord::Migration
  def self.up
    create_table :votes do |t|
      t.string :uuid, :limit => 32, :unique=> true, :null => false
      t.integer :election_id, :null => false, :on_delete => :cascade
      t.integer :candidate_id, :null => true, :on_delete => :cascade
    end
  end

  def self.down
    drop_table :votes
  end
end
